<?php
$item = $this->oItem;

if ($item->idCouponCode)
	$item->deliveryCost = 0;
//print_r($item);
?>
<table width="100%" cellspacing="0" cellpadding="8" class="newsfeed" id="myTable" border="0"  valign="top">
<thead>
	<tr>
		<th>&nbsp;</th>
		<th>&nbsp;</th>
	</tr>
</thead>	
<tbody>

	<tr>
		<td>	Restaurant	</td>
		<td>
			<?php echo $item->restaurant_name; ?>
		</td>
	</tr>

	<tr>
		<td>	User	</td>
		<td>
			<?php echo $item->user_name; ?>
		</td>
	</tr>
	
	<tr>
		<td>	Address	</td>
		<td>
			<?php echo $item->state; ?> <br/>
			<?php echo $item->city; ?> <br/>
			<?php echo $item->address; ?> <br/>
			<?php echo $item->phone; ?> <br/>
		</td>
	</tr>
	
	<tr>
		<td>	e-mail	</td>
		<td>
			<?php echo $item->email; ?>
		</td>
	</tr>
	
	<tr>
		<td>	CouponCode	</td>
		<td>
			<?php echo $item->idCouponCode; ?>
		</td>
	</tr>

	<tr>
		<td>	Amount order	</td>
		<td>
			$<?php echo $item->totalAmount; ?>
		</td>
	</tr>
	<tr>
		<td>	Delivery cost	</td>
		<td>
			$<?php echo $item->deliveryCost; ?>
		</td>
	</tr>

	<tr>
		<td>	Added	</td>
		<td>
			<?php echo $item->added; ?>
		</td>
	</tr>
<?php if ($item->delivered) {?>	
	<tr>
		<td>	Delivered 	</td>
		<td>
			<?php echo $item->delivered; ?>
		</td>
	</tr>
<?php }?>	

	<tr>
		<td>Items</td>
		<td>
<table border="1">			
	<tr>
		<td colspan="4"></td>
	</tr>
			<?php 
	foreach ($this->menuItems as $menuItem)
		{
?>
	<tr>
		<td>
			&nbsp; <?php echo $menuItem->name; ?> &nbsp; 
		</td>
		<td>
			&nbsp; <?php echo $menuItem->quantity; ?> * $<?php echo $menuItem->price; ?> &nbsp; 
		</td>
		<td>
			&nbsp; $<?php echo ($menuItem->quantity * $menuItem->price); ?> &nbsp; 
			
		</td>

		<td width="50%">
			&nbsp; <?php echo $menuItem->special; ?> &nbsp; 
		</td>
		
	</tr>			
<?php }?>
	<tr>
		<td colspan="1"></td>
		<td>&nbsp; Delivery Cost &nbsp; </td><td> &nbsp;  $<?php echo $item->deliveryCost; ?>&nbsp; </td>
	</tr>


	<tr>
		<td colspan="1"></td>
		<td>&nbsp; Total &nbsp; </td><td> &nbsp;  $<?php echo ($item->totalAmount + $item->deliveryCost); ?>&nbsp; </td>
	</tr>
	<tr>
		<td colspan="4"></td>
	</tr>
	
</table>

		</td>
	</tr>
	
	<tr>
		<td>
		</td>
		<td>
		<?php if ('new' == $item->status) {?>
			<a class="sexybutton sexysimple sexymagenta" href="/adminarea/updateorder/id/<?php echo $this->id ?>/status/accept">Accept order</a> &nbsp;&nbsp;&nbsp; 
			<a class="sexybutton sexysimple sexymagenta" href="/adminarea/updateorder/id/<?php echo $this->id ?>/status/reject">Reject order</a> <br />
		 <?php }?>
		<?php if ('processing' == $item->status) {?>
			<a class="sexybutton sexysimple sexymagenta" href="/adminarea/updateorder/id/<?php echo $this->id ?>/status/delivered">Delivered</a> &nbsp;&nbsp;&nbsp; 
		 <?php }?>
		 
		</td>
	</tr>	
</tbody>	
</table>

